<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>用户登陆页面 - 小黄车 前台</title>
		<%@ include file="/common/include/title.jsp"%>
	</head>
	<body>
		<%@ include file="/common/include/header.jsp"%>
		<script type="text/javascript">
		function refreshImg()
		{
			/*重新修改img，src的值，让浏览器强制重新从服务器加载一次
			
			获取img DOM元素
			获取img中的src的值
			*/
			
			//查看容器大小
			//alert($("#imgCode").length);
			
			//获取src的值
 			//alert($("#imgCode").attr("src"));
			//修改img src的值
			
			//浏览器对相同的url有缓存，所以当有缓存的时候，先加载缓存中的内容
			//只要url不同就可以重新加载服务器端了
			//后面跟个变量  时间是个好变量 new Date(); 可以保证每次请求的url都不一样
			$("#imgCode").attr("src","${rootPath}/CommonServlet?method=randImg&now="+new Date());
			
			 return false;
		}
		</script>
		<div class="container">
			<div class="col-sm-8 col-sm-offset-1">
				<form id="form" class="form-horizontal" method="post"
					action="${rootPath }/UsersNoLoginServlet?method=UsersLoginSubmit">
					<input type="hidden" name="returnUrl" value="">
	
					<h2 class="col-sm-offset-1 form-signin-heading">登陆</h2>
					<div class="form-group">
						<label for="email" class="col-sm-2 control-label">邮箱</label>
						<div class="col-sm-8">
							<input type="text" id="email" name="email" class="form-control"
								value="${requestScope.email }" placeholder="邮箱">
						</div>
					</div>
					<div class="form-group">
						<label for="inputPassword" class="col-sm-2 control-label">密码</label>
						<div class="col-sm-8">
							<input type="password" name="password" id="inputPassword"
								class="form-control" placeholder="密码" />
						</div>
					</div>
					<div class="form-group">
						<label for="email" class="col-sm-2 control-label">验证码</label>
						<div class="col-sm-8">
							<div class="input-group">
								<span class="input-group-addon"> 
								<a href="# " tabindex="-1"	onclick="return refreshImg();">
								 <img id="imgCode" src="${rootPath}/CommonServlet?method=randImg" title="点击刷新验证码" width="75" height="20" />
								</a>
								</span>
								 <input type="text" id="code" name="code" class="form-control"
									placeholder="验证码">
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-2">
							<div class="input-group">
								<div class="checkbox">
									<label> <input type="checkbox" value="remember-me">
										记住我
									</label>
								</div>
								<span class="input-group-addon"> <a href="forgetPass.html">忘记密码</a>
								</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-2">
							<button class="btn btn-lg btn-primary" type="submit">登陆</button>
							<a href="regsiter.html" class="btn btn-lg btn-primary">注册</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	
		<!-- 提示信息 -->
		<div class="container">
			<div class="col-sm-8 col-sm-offset-1">
				
				<div class="alert alert-warning alert-dismissible fade in"
					role="alert">
					<button type="button" class="close" data-dismiss="alert"
						aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
					${info }
				</div>
			</div>
		</div>
	
		<%@ include file="/common/include/footer.jsp"%>
	</body>
</html>